package com.warren.constants;

/**
 * @author warren
 * @date 2021/3/28 0028 10:03
 * @Description spring security相关配置常量
 **/
public final class SecurityContants {
    /**
     * 角色的key
     */
    public static final String ROLE_CLAIMS = "rol";

    /**
     * rememberMe 为false的时候过期时间为1个小时
     */
    public static final long EXPIRATION = 60 * 60L;

    public static final long EXPIRATION_REMEMBER = 60 * 60 * 24 * 7L;

    /**
     * JWT签名秘钥硬编码到应用到程序代码中，应该存放在环境变量中
     */
    public static final String JWT_SECRET_KEY =  "C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w";

    //JWT token defaults
    public static final String TOKEN_HEADER = "Authorization";
    public static final String TOKEN_PREFIX = "Bearer";
    public static final String TOKEN_TYPE = "JWT";

    /**
     * Swagger 白名单
     */
    public static final String[] SWAGGER_WHITELIST = {
            "/swagger-ui.html",
            "/swagger-ui/*",
            "/swagger-resources/**",
            "/v2/api-docs",
            "/v3/api-docs",
            "/webjars/**"
    };
    /**
     * knife4j 白名单
     */
    public static final String[] KNIFE4J_WHITELIST = {
            "/doc.html"
    };

    /**
     * 系统白名单
     */
    public static final String[] SYSTEM_WHITELIST = {
            "/login",
            "/users/sign-up"
    };


    public static final String AUTH_LOGIN_URL = "/login";
}
